//底部日历弹框
import 'package:flutter/material.dart';
import 'package:znmm/config/app_color.dart';
import 'package:provider/provider.dart';

import 'calendar_bottom_view.dart';
import 'calendar_provider_mag.dart';

class CalendarBottomSheet {
  //弹出底部日历
  static void showBottomCalendar(
    BuildContext context, {
    required Function(dynamic object) clickCallback,
    required final DateTime tDefDateTime,
  }) {
    showModalBottomSheet(
        context: context,
        isDismissible: true,
        isScrollControlled: true,
        backgroundColor: AppColor.background,
        shape: const RoundedRectangleBorder(
            borderRadius: BorderRadius.only(
                topLeft: Radius.circular(8), topRight: Radius.circular(8))),
        builder: (BuildContext context) {
          return MultiProvider(
            providers: [
              ChangeNotifierProvider(create: (_) => CalendarProviderMag()),
            ],
            child: CalendarBottomView(
              clickBack: clickCallback,
              tDefDateTime: tDefDateTime,
            ),
          );
        });
  }
}
